<template>
	<view class="coma_box">
		<text style="font-size: 50rpx;">子组件A</text>
		<view>
			<text>父组件传进来的值：</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<button type="primary" @click="sendData()">传值给组件B</button>
	</view>
</template>

<script>
	export default {
		props: ['intent'], 
		name: "comA",
		data() {
			return {
	
			};
		},
		methods: {
			sendData() { 
				console.warn("-----comA-----sendData---->", this.intent);
				uni.$emit('getIntent', this.intent);
			}
		}
	}
</script>

<style>
	.coma_box {
		background-color: #f8a555;
		padding: 20rpx;
		border-radius: 8rpx;
		margin: 10rpx 0;
	}
	button {
		margin-top: 10rpx;
	}
</style>